package com.msi.manning.unlockingandroid;
import com.msi.manning.unlockingandroid.R;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class AWhereDoyouLive extends Activity
{
 @Override 
 public void OnCreate(Bundle icicle)
 {
   super.omCreate(icicle);
   setContentView(R.layout.main); // Book notes : 1
   final EditText addressfield = (EditText) findViewById(R.id.address); // 2
   final Button button = (Button) findViewById(R.id.launchmap); //3
   button.setOnClickListener(new 
   Button.OnClickListener()
   {
    public void onClick(View v)
	{
	 try
	 {
	  String address = addressfield.getText().toString();//4
	  address = address.replace('','+');
	  intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address)); //5
	  startActivity(myIntent); //6
	  }
	 catch(Exception e)
	  {
	   // some action
	   }
	 }
	});
	
  }
 }


	 